;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-advanced-reader.ss" "lang")((modname expt) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ())))
(define (myexpt b n)
  (if (= n 0)
      1
      (* b (myexpt b (- n 1)))))

(define (myexpt-use-iter b n)
  (myexpt-iter b n 1))

(define (myexpt-iter b counter product)
  (if (= counter 0)
      product
      (myexpt-iter b (- counter 1) (* b product))))
